﻿// ....................................................................................................................
//	Author: Copyright (C) 2012 Ing. Marek Hubal
//	Email: hubal@acasoftware.org
// ....................................................................................................................

using System;

namespace core
{
    /// <summary>Trieda ISettings</summary>
	public class ISettings : IDisposable
	{
        public int AppForm_Left, AppForm_Top; // Posledna pozicia hlavneho okna
        public int AppForm_Width, AppForm_Height; // Posledne rozmery hlavneho okna
        public bool AppForm_RememberLastPosition; // Priznak ulozenie poslednej pozicie a rozmerov hlavneho okna
        public bool AppForm_LastMaximized; // Priznak poslednej maximalizacie hlavneho okna
        public bool AppForm_ForceMaximize; // Priznak maximalizacie hlavneho okna po spusteni
        public bool AppForm_MinimizeToTry; // Priznak minimalizacie hlavneho okna do system try
        public int AppForm_TabPosition; // Umiestnenie zaloziek v TabControl 0 - hore, 1 - vpravo, 2 - dole, 3 - vlavo

        public bool App_ShowQuitQuestion; // Priznak zobrazenia potvrdenia ukoncenia aplikacie
        public bool App_OnlyOneInstance; // Priznak povolenia spustenia len jedinej instancie
        public string App_Shortcuts; // Serializovane klavesove skratky
        public IParamList App_PanelSettings; // Nastavenia vsetkych panelov
        public bool App_AutoShowUpdateAvailable; // Priznak moznosti zobrazenia dialogu s dostupnou aktualizaciou

        public int FileExplorer_DisplaySizeMode; // Sposob zobrazenie velkosti alebo kapacity
        public int FileExplorer_DisplayIconMode; // Sposob zobrazenie ikoniek poloziek
        public bool FileExplorer_DirsInBraces; // Priznak zobrazenia nazvov priecinkov v zatvorkach
        public bool FileExplorer_ShowAdminShares; // Priznak zobrazenia admin zdielani
        public bool FileExplorer_MoveToNextAfterSelect; // Priznak posunu kurzora po oznaceni
        public bool FileExplorer_AutoReloadAfterChange; // Priznak automatickeho reload po zmene obsahu
        public int FileExplorer_ShowItemMenuMode; // Mod zobrazenia item menu
        public int FileExplorer_ItemToolTipMode; // Mod zobrazenia informacie o polozke
        public bool FileExplorer_SelectAfterCalculateFolderSize; // Priznak oznacenia priecinku po vypocte jeho velkosti
        public int FileExplorer_CopyItemMode; // Mod kopirovania poloziek
        public int FileExplorer_MoveItemMode; // Mod presunu poloziek
        public bool FileExplorer_ConfirmCopy; // Potvrdenie kopirovania
        public bool FileExplorer_ConfirmMove; // Potvrdenie presunu
        public bool FileExplorer_ConfirmDelete; // Potvrdenie mazania
        public bool FileExplorer_ConfirmMoveToTrash; // Potvrdenie presunu do kosa
        public string FileExplorer_ExternalEditor; // Plny nazov externeho editora
        public string FileExplorer_ExternalViewer; // Plny nazov externeho prehliadaca
        public string FileExplorer_InternalViewerSettings; // Nastavenia interneho prehliadaca

        /// <summary>Konstruktor</summary>
        public ISettings()
        {
            App_PanelSettings = new IParamList();

            LoadDefaults(); // Nacitam prednastavene hodnoty
        }
        /// <summary>Dispose metoda</summary>
        public void Dispose()
        {
            App_PanelSettings = (IParamList)ICore.DisposeObject(App_PanelSettings);
        }

        /// <summary>Nacitanie prednastavenych hodnot</summary>
        public void LoadDefaults()
        {
            AppForm_Left = 100;
            AppForm_Top = 100;
            AppForm_Width = 600;
            AppForm_Height = 500;
            AppForm_RememberLastPosition = true;
            AppForm_LastMaximized = false;
            AppForm_ForceMaximize = false;
            App_ShowQuitQuestion = true;
            AppForm_MinimizeToTry = false;
            App_OnlyOneInstance = false;
            App_Shortcuts = "";
            AppForm_TabPosition = 0;
            App_PanelSettings.Clear();
            FileExplorer_DisplaySizeMode = 0;
            FileExplorer_DisplayIconMode = 2;
            FileExplorer_DirsInBraces = false;
            FileExplorer_ShowAdminShares = false;
            FileExplorer_MoveToNextAfterSelect = true;
            FileExplorer_AutoReloadAfterChange = true;
            FileExplorer_ShowItemMenuMode = 0;
            FileExplorer_ItemToolTipMode = 1;
            FileExplorer_SelectAfterCalculateFolderSize = true;
            FileExplorer_CopyItemMode = 1;
            FileExplorer_MoveItemMode = 1;
            FileExplorer_ConfirmCopy = true;
            FileExplorer_ConfirmMove = true;
            FileExplorer_ConfirmDelete = true;
            FileExplorer_ConfirmMoveToTrash = true;
            App_AutoShowUpdateAvailable = true;
            FileExplorer_ExternalEditor = "";
            FileExplorer_ExternalViewer = "";
            FileExplorer_InternalViewerSettings = "";
        }
        /// <summary>Skopirovanie obsahu objektu</summary>
        /// <param name="pValue">objekt pre skopirovanie</param>
        public void Assign(ISettings pValue)
        {
            AppForm_Left = pValue.AppForm_Left;
            AppForm_Top = pValue.AppForm_Top;
            AppForm_Width = pValue.AppForm_Width;
            AppForm_Height = pValue.AppForm_Height;
            AppForm_RememberLastPosition = pValue.AppForm_RememberLastPosition;
            AppForm_LastMaximized = pValue.AppForm_LastMaximized;
            AppForm_ForceMaximize = pValue.AppForm_ForceMaximize;
            App_ShowQuitQuestion = pValue.App_ShowQuitQuestion;
            AppForm_MinimizeToTry = pValue.AppForm_MinimizeToTry;
            App_OnlyOneInstance = pValue.App_OnlyOneInstance;
            App_Shortcuts = pValue.App_Shortcuts;
            AppForm_TabPosition = pValue.AppForm_TabPosition;
            App_PanelSettings.Assign(pValue.App_PanelSettings);
            FileExplorer_DisplaySizeMode = pValue.FileExplorer_DisplaySizeMode;
            FileExplorer_DisplayIconMode = pValue.FileExplorer_DisplayIconMode;
            FileExplorer_DirsInBraces = pValue.FileExplorer_DirsInBraces;
            FileExplorer_ShowAdminShares = pValue.FileExplorer_ShowAdminShares;
            FileExplorer_MoveToNextAfterSelect = pValue.FileExplorer_MoveToNextAfterSelect;
            FileExplorer_AutoReloadAfterChange = pValue.FileExplorer_AutoReloadAfterChange;
            FileExplorer_ShowItemMenuMode = pValue.FileExplorer_ShowItemMenuMode;
            FileExplorer_ItemToolTipMode = pValue.FileExplorer_ItemToolTipMode;
            FileExplorer_SelectAfterCalculateFolderSize = pValue.FileExplorer_SelectAfterCalculateFolderSize;
            FileExplorer_CopyItemMode = pValue.FileExplorer_CopyItemMode;
            FileExplorer_MoveItemMode = pValue.FileExplorer_MoveItemMode;
            FileExplorer_ConfirmCopy = pValue.FileExplorer_ConfirmCopy;
            FileExplorer_ConfirmMove = pValue.FileExplorer_ConfirmMove;
            FileExplorer_ConfirmDelete = pValue.FileExplorer_ConfirmDelete;
            FileExplorer_ConfirmMoveToTrash = pValue.FileExplorer_ConfirmMoveToTrash;
            App_AutoShowUpdateAvailable = pValue.App_AutoShowUpdateAvailable;
            FileExplorer_ExternalEditor = pValue.FileExplorer_ExternalEditor;
            FileExplorer_ExternalViewer = pValue.FileExplorer_ExternalViewer;
            FileExplorer_InternalViewerSettings = pValue.FileExplorer_InternalViewerSettings;
        }
        /// <summary>Nacitanie nastavenia z konfiguracie</summary>
        public void Load()
        {
            AppForm_Left = IApp.Config.GetParam("APPFORM_LEFT", AppForm_Left);
            AppForm_Top = IApp.Config.GetParam("APPFORM_TOP", AppForm_Top);
            AppForm_Width = IApp.Config.GetParam("APPFORM_WIDTH", AppForm_Width);
            AppForm_Height = IApp.Config.GetParam("APPFORM_HEIGHT", AppForm_Height);
            AppForm_RememberLastPosition = IApp.Config.GetParam("APPFORM_REMEMBER_LAST_POSITION", AppForm_RememberLastPosition);
            AppForm_LastMaximized = IApp.Config.GetParam("APPFORM_LAST_MAXIMIZED", AppForm_LastMaximized);
            AppForm_ForceMaximize = IApp.Config.GetParam("APPFORM_FORCE_MAXIMIZED", AppForm_ForceMaximize);
            App_ShowQuitQuestion = IApp.Config.GetParam("APP_SHOW_QUIT_QUESTION", App_ShowQuitQuestion);
            AppForm_MinimizeToTry = IApp.Config.GetParam("APPFORM_MINIMIZE_TO_TRY", AppForm_MinimizeToTry);
            App_OnlyOneInstance = IApp.Config.GetParam("APP_ONLY_ONE_INSTANCE", App_OnlyOneInstance);
            App_Shortcuts = IApp.Config.GetParam("APP_SHORTCUTS", App_Shortcuts);
            AppForm_TabPosition = IApp.Config.GetParam("APPFORM_TAB_POSITION", AppForm_TabPosition);
            App_PanelSettings.Deserialize(IApp.Config.GetParam("APP_PANEL_SETTINGS", ""), true);
            FileExplorer_DisplaySizeMode = IApp.Config.GetParam("FILE_EXPLORER_DISPLAY_SIZE_MODE", FileExplorer_DisplaySizeMode);
            FileExplorer_DisplayIconMode = IApp.Config.GetParam("FILE_EXPLORER_DISPLAY_ICON_MODE", FileExplorer_DisplayIconMode);
            FileExplorer_DirsInBraces = IApp.Config.GetParam("FILE_EXPLORER_DIRS_IN_BRACES", FileExplorer_DirsInBraces);
            FileExplorer_ShowAdminShares = IApp.Config.GetParam("FILE_EXPLORER_SHOW_ADMIN_SHARES", FileExplorer_ShowAdminShares);
            FileExplorer_MoveToNextAfterSelect = IApp.Config.GetParam("FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT", FileExplorer_MoveToNextAfterSelect);
            FileExplorer_AutoReloadAfterChange = IApp.Config.GetParam("FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE", FileExplorer_AutoReloadAfterChange);
            FileExplorer_ShowItemMenuMode = IApp.Config.GetParam("FILE_EXPLORER_SHOW_ITEM_MENU_MODE", FileExplorer_ShowItemMenuMode);
            FileExplorer_ItemToolTipMode = IApp.Config.GetParam("FILE_EXPLORER_ITEM_TOOL_TIP_MODE", FileExplorer_ItemToolTipMode);
            FileExplorer_SelectAfterCalculateFolderSize = IApp.Config.GetParam("FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE", FileExplorer_SelectAfterCalculateFolderSize);
            FileExplorer_CopyItemMode = IApp.Config.GetParam("FILE_EXPLORER_COPY_MODE", FileExplorer_CopyItemMode);
            FileExplorer_MoveItemMode = IApp.Config.GetParam("FILE_EXPLORER_MOVE_MODE", FileExplorer_MoveItemMode);
            FileExplorer_ConfirmCopy = IApp.Config.GetParam("FILE_EXPLORER_CONFIRM_COPY", FileExplorer_ConfirmCopy);
            FileExplorer_ConfirmMove = IApp.Config.GetParam("FILE_EXPLORER_CONFIRM_MOVE", FileExplorer_ConfirmMove);
            FileExplorer_ConfirmDelete = IApp.Config.GetParam("FILE_EXPLORER_CONFIRM_DELETE", FileExplorer_ConfirmDelete);
            FileExplorer_ConfirmMoveToTrash = IApp.Config.GetParam("FILE_EXPLORER_CONFIRM_MOVE_TO_TRASH", FileExplorer_ConfirmMoveToTrash);
            App_AutoShowUpdateAvailable = IApp.Config.GetParam("APP_AUTO_SHOW_UPDATE_AVAILABLE", App_AutoShowUpdateAvailable);
            FileExplorer_ExternalEditor = IApp.Config.GetParam("FILE_EXPLORER_EXTERNAL_EDITOR", FileExplorer_ExternalEditor);
            FileExplorer_ExternalViewer = IApp.Config.GetParam("FILE_EXPLORER_EXTERNAL_VIEWER", FileExplorer_ExternalViewer);
            FileExplorer_InternalViewerSettings = IApp.Config.GetParam("FILE_EXPLORER_INTERNAL_VIEWER_SETTINGS", FileExplorer_InternalViewerSettings);
        }
        /// <summary>Ulozenie nastavenia do konfiguracie</summary>
        public void Save()
        {
            IApp.Config.SetParam("APPFORM_LEFT", AppForm_Left);
            IApp.Config.SetParam("APPFORM_TOP", AppForm_Top);
            IApp.Config.SetParam("APPFORM_WIDTH", AppForm_Width);
            IApp.Config.SetParam("APPFORM_HEIGHT", AppForm_Height);
            IApp.Config.SetParam("APPFORM_REMEMBER_LAST_POSITION", AppForm_RememberLastPosition);
            IApp.Config.SetParam("APPFORM_LAST_MAXIMIZED", AppForm_LastMaximized);
            IApp.Config.SetParam("APPFORM_FORCE_MAXIMIZED", AppForm_ForceMaximize);
            IApp.Config.SetParam("APP_SHOW_QUIT_QUESTION", App_ShowQuitQuestion);
            IApp.Config.SetParam("APPFORM_MINIMIZE_TO_TRY", AppForm_MinimizeToTry);
            IApp.Config.SetParam("APP_ONLY_ONE_INSTANCE", App_OnlyOneInstance);
            IApp.Config.SetParam("APP_SHORTCUTS", App_Shortcuts);
            IApp.Config.SetParam("APPFORM_TAB_POSITION", AppForm_TabPosition);
            IApp.Config.SetParam("APP_PANEL_SETTINGS", App_PanelSettings.Serialize(true));
            IApp.Config.SetParam("FILE_EXPLORER_DISPLAY_SIZE_MODE", FileExplorer_DisplaySizeMode);
            IApp.Config.SetParam("FILE_EXPLORER_DISPLAY_ICON_MODE", FileExplorer_DisplayIconMode);
            IApp.Config.SetParam("FILE_EXPLORER_DIRS_IN_BRACES", FileExplorer_DirsInBraces);
            IApp.Config.SetParam("FILE_EXPLORER_SHOW_ADMIN_SHARES", FileExplorer_ShowAdminShares);
            IApp.Config.SetParam("FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT", FileExplorer_MoveToNextAfterSelect);
            IApp.Config.SetParam("FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE", FileExplorer_AutoReloadAfterChange);
            IApp.Config.SetParam("FILE_EXPLORER_SHOW_ITEM_MENU_MODE", FileExplorer_ShowItemMenuMode);
            IApp.Config.SetParam("FILE_EXPLORER_ITEM_TOOL_TIP_MODE", FileExplorer_ItemToolTipMode);
            IApp.Config.SetParam("FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE", FileExplorer_SelectAfterCalculateFolderSize);
            IApp.Config.SetParam("FILE_EXPLORER_COPY_MODE", FileExplorer_CopyItemMode);
            IApp.Config.SetParam("FILE_EXPLORER_MOVE_MODE", FileExplorer_MoveItemMode);
            IApp.Config.SetParam("FILE_EXPLORER_CONFIRM_COPY", FileExplorer_ConfirmCopy);
            IApp.Config.SetParam("FILE_EXPLORER_CONFIRM_MOVE", FileExplorer_ConfirmMove);
            IApp.Config.SetParam("FILE_EXPLORER_CONFIRM_DELETE", FileExplorer_ConfirmDelete);
            IApp.Config.SetParam("FILE_EXPLORER_CONFIRM_MOVE_TO_TRASH", FileExplorer_ConfirmMoveToTrash);
            IApp.Config.SetParam("APP_AUTO_SHOW_UPDATE_AVAILABLE", App_AutoShowUpdateAvailable);
            IApp.Config.SetParam("FILE_EXPLORER_EXTERNAL_EDITOR", FileExplorer_ExternalEditor);
            IApp.Config.SetParam("FILE_EXPLORER_EXTERNAL_VIEWER", FileExplorer_ExternalViewer);
            IApp.Config.SetParam("FILE_EXPLORER_INTERNAL_VIEWER_SETTINGS", FileExplorer_InternalViewerSettings);
        }

        /// <summary>Zmena objektu pomocou formulara</summary>
        /// <returns>true / false</returns>
        public bool EditWithForm()
        {
            using (IForm_EditSettings F = new IForm_EditSettings()) // Vytvorim form
            {
                F.Value.Assign(this); // Ulozim aktualne hodnoty
                bool B = F.ShowDialog() == System.Windows.Forms.DialogResult.OK; // Zobrazim okno
                if (B) Assign(F.Value); // Ulozim vysledky
                return B;
            }
        }

        /// <summary>Prevod ID nastavenia na textovy popis</summary>
        /// <param name="pID">ID nastavenia</param>
        /// <returns>textovy popis</returns>
        public static string ID2Str(int pID)
        {
            switch (pID)
            {
                case SETTINGS_ID_APP_ONLY_ONE_INSTANCE: return lang.SETTINGS_ID_APP_ONLY_ONE_INSTANCE_TEXT;
                case SETTINGS_ID_APPFORM_MINIMIZE_TO_TRAY_ICON: return lang.SETTINGS_ID_APPFORM_MINIMIZE_TO_TRAY_ICON_TEXT;
                case SETTINGS_ID_APPFORM_MAXIMIZE_ON_START: return lang.SETTINGS_ID_APPFORM_MAXIMIZE_ON_START_TEXT;
                case SETTINGS_ID_APPFORM_REMEMBER_LAST_POSITION: return lang.SETTINGS_ID_APPFORM_REMEMBER_LAST_POSITION_TEXT;
                case SETTINGS_ID_APP_SHOW_QUIT_QUESTION: return lang.SETTINGS_ID_APP_SHOW_QUIT_QUESTION_TEXT;
                case SETTINGS_ID_APPFORM_TAB_POSITION: return lang.SETTINGS_ID_APPFORM_TAB_POSITION_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_SIZE_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_DISPLAY_SIZE_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_ICON_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_DISPLAY_ICON_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_DIRS_IN_BRACES: return lang.SETTINGS_ID_FILE_EXPLORER_DIRS_IN_BRACES_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ADMIN_SHARES: return lang.SETTINGS_ID_FILE_EXPLORER_SHOW_ADMIN_SHARES_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT: return lang.SETTINGS_ID_FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE: return lang.SETTINGS_ID_FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ITEM_MENU_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_SHOW_ITEM_MENU_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_ITEM_TOOL_TIP_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_ITEM_TOOL_TIP_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE: return lang.SETTINGS_ID_FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_COPY_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_COPY_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_MOVE_MODE: return lang.SETTINGS_ID_FILE_EXPLORER_MOVE_MODE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_COPY: return lang.SETTINGS_ID_FILE_EXPLORER_CONFIRM_COPY_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_MOVE: return lang.SETTINGS_ID_FILE_EXPLORER_CONFIRM_MOVE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE: return lang.SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TO_TRASH: return lang.SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TO_TRASH_TEXT;
                case SETTINGS_ID_APP_AUTO_SHOW_UPDATE_AVAILABLE: return lang.SETTINGS_ID_APP_AUTO_SHOW_UPDATE_AVAILABLE_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_EDITOR: return lang.SETTINGS_ID_FILE_EXPLORER_EXTERNAL_EDITOR_TEXT;
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_VIEWER: return lang.SETTINGS_ID_FILE_EXPLORER_EXTERNAL_VIEWER_TEXT;
                default: return "";
            }
        }
        /// <summary>Prevod ID skupiny na textovy popis</summary>
        /// <param name="pID">ID skupiny</param>
        /// <returns>textovy popis</returns>
        public static string GroupID2Str(int pID)
        {
            switch (pID)
            {
                case SETTINGS_GROUP_COMMON: return lang.SETTINGS_GROUP_COMMON_TEXT;
                case SETTINGS_GROUP_FILE_EXPLORER: return lang.SETTINGS_GROUP_FILE_EXPLORER_TEXT;
                default: return "";
            }
        }
        /// <summary>Prevod ID podskupiny na textovy popis</summary>
        /// <param name="pID">ID podskupiny</param>
        /// <returns>textovy popis</returns>
        public static string SubgroupID2Str(int pID)
        {
            switch (pID)
            {
                case SETTINGS_SUBGROUP_COMMON_COMMON: return lang.SETTINGS_SUBGROUP_COMMON_COMMON_TEXT;
                case SETTINGS_SUBGROUP_COMMON_MAIN_WINDOW: return lang.SETTINGS_SUBGROUP_COMMON_MAIN_WINDOW_TEXT;
                case SETTINGS_SUBGROUP_FILE_EXPLORER_COMMON: return lang.SETTINGS_SUBGROUP_FILE_EXPLORER_COMMON_TEXT;
                case SETTINGS_SUBGROUP_FILE_EXPLORER_VIEW: return lang.SETTINGS_SUBGROUP_FILE_EXPLORER_VIEW_TEXT;
                case SETTINGS_SUBGROUP_FILE_EXPLORER_CONTENT: return lang.SETTINGS_SUBGROUP_FILE_EXPLORER_CONTENT_TEXT;
                case SETTINGS_SUBGROUP_FILE_EXPLORER_OPERATIONS: return lang.SETTINGS_SUBGROUP_FILE_EXPLORER_OPERATIONS_TEXT;
                case SETTINGS_SUBGROUP_FILE_EXPLORER_CONFIRMATION: return lang.SETTINGS_SUBGROUP_FILE_EXPLORER_CONFIRMATION_TEXT;
                default: return "";
            }
        }
        /// <summary>Prevod ID nastavenia na ID skupiny</summary>
        /// <param name="pID">ID nastavenia</param>
        /// <returns>ID skupiny</returns>
        public static int ID2GroupID(int pID)
        {
            switch (pID)
            {
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_SIZE_MODE:
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_ICON_MODE:
                case SETTINGS_ID_FILE_EXPLORER_DIRS_IN_BRACES:
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ADMIN_SHARES:
                case SETTINGS_ID_FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT:
                case SETTINGS_ID_FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE:
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ITEM_MENU_MODE:
                case SETTINGS_ID_FILE_EXPLORER_ITEM_TOOL_TIP_MODE:
                case SETTINGS_ID_FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE:
                case SETTINGS_ID_FILE_EXPLORER_COPY_MODE:
                case SETTINGS_ID_FILE_EXPLORER_MOVE_MODE:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_COPY:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_MOVE:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TO_TRASH:
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_EDITOR:
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_VIEWER:
                    return SETTINGS_GROUP_FILE_EXPLORER;
                default: return SETTINGS_GROUP_COMMON;
            }
        }
        /// <summary>Prevod ID nastavenia na ID podskupiny</summary>
        /// <param name="pID">ID nastavenia</param>
        /// <returns>ID podskupiny</returns>
        public static int ID2SubroupID(int pID)
        {
            switch (pID)
            {
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_COPY:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_MOVE:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE:
                case SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TO_TRASH:
                    return SETTINGS_SUBGROUP_FILE_EXPLORER_CONFIRMATION;
                case SETTINGS_ID_FILE_EXPLORER_COPY_MODE:
                case SETTINGS_ID_FILE_EXPLORER_MOVE_MODE:
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_EDITOR:
                case SETTINGS_ID_FILE_EXPLORER_EXTERNAL_VIEWER:
                    return SETTINGS_SUBGROUP_FILE_EXPLORER_OPERATIONS;
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ADMIN_SHARES:
                case SETTINGS_ID_FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE:
                case SETTINGS_ID_FILE_EXPLORER_ITEM_TOOL_TIP_MODE:
                    return SETTINGS_SUBGROUP_FILE_EXPLORER_CONTENT;
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_SIZE_MODE:
                case SETTINGS_ID_FILE_EXPLORER_DISPLAY_ICON_MODE:
                case SETTINGS_ID_FILE_EXPLORER_DIRS_IN_BRACES:
                case SETTINGS_ID_FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT:
                case SETTINGS_ID_FILE_EXPLORER_SHOW_ITEM_MENU_MODE:
                case SETTINGS_ID_FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE:
                    return SETTINGS_SUBGROUP_FILE_EXPLORER_VIEW;
                case SETTINGS_ID_APPFORM_MAXIMIZE_ON_START:
                case SETTINGS_ID_APPFORM_REMEMBER_LAST_POSITION:
                case SETTINGS_ID_APPFORM_MINIMIZE_TO_TRAY_ICON:
                case SETTINGS_ID_APPFORM_TAB_POSITION:
                    return SETTINGS_SUBGROUP_COMMON_MAIN_WINDOW;
                default: return SETTINGS_SUBGROUP_COMMON_COMMON;
            }
        }

        public const int SETTINGS_ID_APP_SHOW_QUIT_QUESTION = 0;
        public const int SETTINGS_ID_APPFORM_REMEMBER_LAST_POSITION = 1;
        public const int SETTINGS_ID_APPFORM_MAXIMIZE_ON_START = 2;
        public const int SETTINGS_ID_APPFORM_MINIMIZE_TO_TRAY_ICON = 3;
        public const int SETTINGS_ID_APP_ONLY_ONE_INSTANCE = 4;
        public const int SETTINGS_ID_APPFORM_TAB_POSITION = 5;
        public const int SETTINGS_ID_FILE_EXPLORER_DISPLAY_SIZE_MODE = 6;
        public const int SETTINGS_ID_FILE_EXPLORER_DISPLAY_ICON_MODE = 7;
        public const int SETTINGS_ID_FILE_EXPLORER_DIRS_IN_BRACES = 8;
        public const int SETTINGS_ID_FILE_EXPLORER_SHOW_ADMIN_SHARES = 9;
        public const int SETTINGS_ID_FILE_EXPLORER_MOVE_TO_NEXT_AFTER_SELECT = 10;
        public const int SETTINGS_ID_FILE_EXPLORER_AUTO_RELOAD_AFTER_CHANGE = 11;
        public const int SETTINGS_ID_FILE_EXPLORER_SHOW_ITEM_MENU_MODE = 12;
        public const int SETTINGS_ID_FILE_EXPLORER_ITEM_TOOL_TIP_MODE = 13;
        public const int SETTINGS_ID_FILE_EXPLORER_SELECT_AFTER_CALCULATE_FOLDER_SIZE = 14;
        public const int SETTINGS_ID_FILE_EXPLORER_COPY_MODE = 15;
        public const int SETTINGS_ID_FILE_EXPLORER_MOVE_MODE = 16;
        public const int SETTINGS_ID_FILE_EXPLORER_CONFIRM_COPY = 17;
        public const int SETTINGS_ID_FILE_EXPLORER_CONFIRM_MOVE = 18;
        public const int SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE = 19;
        public const int SETTINGS_ID_FILE_EXPLORER_CONFIRM_DELETE_TO_TRASH = 20;
        public const int SETTINGS_ID_APP_AUTO_SHOW_UPDATE_AVAILABLE = 21;
        public const int SETTINGS_ID_FILE_EXPLORER_EXTERNAL_EDITOR = 22;
        public const int SETTINGS_ID_FILE_EXPLORER_EXTERNAL_VIEWER = 23;
        public const int SETTINGS_ID_LAST = 24;

        public const int SETTINGS_GROUP_COMMON = 0;
        public const int SETTINGS_GROUP_FILE_EXPLORER = 1;
        public const int SETTINGS_GROUP_LAST = 2;

        public const int SETTINGS_SUBGROUP_COMMON_COMMON = 0;
        public const int SETTINGS_SUBGROUP_COMMON_MAIN_WINDOW = 1;
        public const int SETTINGS_SUBGROUP_FILE_EXPLORER_COMMON = 2;
        public const int SETTINGS_SUBGROUP_FILE_EXPLORER_VIEW = 3;
        public const int SETTINGS_SUBGROUP_FILE_EXPLORER_CONTENT = 4;
        public const int SETTINGS_SUBGROUP_FILE_EXPLORER_OPERATIONS = 5;
        public const int SETTINGS_SUBGROUP_FILE_EXPLORER_CONFIRMATION = 6;
    }
}
